A font is a particular style of typeface such as Arial, Times New Roman or Courier. Fonts which conform to the TrueType Open font standard promulgated by Microsoft Corporation, assignee of the present invention, are commonly referred to as TrueType fonts. TrueType fonts contain font tables that include data, such as glyph outlines, metrics, bitmaps, and mapping information. A glyph outline is a set of mathematical data that describes the shape of the glyph. A glyph is a representation of one or more characters. A single glyph may represent a single character such as the lowercase letter "f" or a single glyph may represent a string of characters such as the ligature "fi".
To display or print a glyph, the glyph outline is first scaled to the selected font size and the resolution of the output device. The scaled glyph outline is then digitized or scan-converted to create a bitmap. Finally, the bitmap is rendered on an output device, such as a monitor or a printer, using a regularly spaced grid of picture elements ("pixels"). Scaling the glyph outline may not produce satisfactory results at all point sizes. At small point sizes, a low-resolution device may not have enough pixels to fill in the outline accurately. To compensate for the lack of pixels, hints or font instructions are added to the font to improve the appearance of the glyph. Hints typically control distances, proportions and pixel patterns.
For a TrueType font, a typographer may specify hints for the entire font or for individual glyphs using an assembly-type language. The typographer may use the low-level TrueType Instruction Set, or a high-level abstraction of the TrueType Instruction Set, such as Type Man Talk. Creating hints using one of the TrueType languages is a tedious process. To begin creating hints for a glyph, the typographer typically prints a glyph outline for the glyph. The glyph outline includes control points which define the shape of the glyph. The typographer uses the glyph outline to visualize critical relationships between the control points, such as the distance in the x-direction between two control points or the distance in the y-direction between two control points. The typographer then draws these relationships on the glyph outline using colored pencils.
Once the typographer draws the relationships on the glyph outline, the typographer translates the colored pencil markings into font instructions. The translation requires that the typographer not only convert the relationships into the proper TrueType commands, but also requires that the typographer order the commands according to the command sequence requirements of the TrueType Instruction Set. For the majority of typographers, the conversion of the relationships into TrueType commands is very tedious. It would be easier for the typographer if the relationships drawn on the glyph outline could be translated into font instructions without the typographer's intervention.
Once the typographer translates the relationships into font instructions, the font instructions are compiled and the compiled font instructions are used to display a bitmap for the glyph. The typographer reviews the bitmap to determine whether the appearance of the hinted glyph is satisfactory. If the appearance of the hinted glyph is not satisfactory, then the typographer must modify the font instructions or add additional font instructions. The typographer must repeat these steps until the appearance of the hinted glyph is satisfactory. If a typographer adds an additional font instruction, then the typographer must determine where to insert the font instruction. Because the TrueType Instruction Set requires certain command sequences, determining where to insert the additional font instruction is usually not obvious. If the additional font instruction is not inserted in the correct sequence, then the font instructions will not be correctly applied.
It would be easier to hint a glyph if the typographer could create hints that could be automatically converted into font instructions. The hints could be created using a graphical user interface and displayed on the glyph as graphical elements. As the typographer hints the glyph, the font instructions could be automatically generated from the graphical elements and then applied to the displayed glyph. If the font instructions could be automatically generated from the graphical elements, then the typographer is freed from the task of creating hinting commands. If the font instructions are applied to the glyph as the hints are created, then the typographer can easily evaluate the effects of the hints on the bitmap of the glyph.
The typographer may need to refine the hinting for a hinted glyph. If the glyph is partially hinted, then the typographer may want to maintain the existing hinting. If the typographer could graphically display the existing hints, then the typographer could add hints or refine the existing hints using the graphical user interface. In addition, graphically displaying the existing hints frees the typographer from a tedious examination of a set of font instructions created by another typographer.
One proposed solution to the hinting problem is provided by the Fontographer program marketed by Macromedia of San Francisco, Calif. The Fontographer program assists a typographer in designing a font by providing tools to support glyph outline design. The Fontographer program also provides some rudimentary hinting tools. The Fontographer program allows a typographer to specify horizontal and vertical serif hints, horizontal and vertical stem hints, and diagonal hints. For example, to specify a vertical stem hint, the typographer selects two points which define the vertical stem and then selects the "make vertical stem" command from the hints menu. The typographer may control the width of the vertical stem by specifying the x-coordinates of the stem. Typically, the x-coordinates of the stem are specified by editing the stem start and stem stop fields of a menu.
One drawback of the Fontographer program is that the hinting tools are limited. The TrueType instruction set includes many hinting instructions which are not supported by the Fontographer program. For example, the Fontographer program does not support interpolations or alignments. Another drawback of the hinting tools provided by the Fontographer program is that hints must be specified in coordinates. For a TrueType font, it is more efficient to specify a hint using a control value. A control value is a value for a dominant width, length, or angle of a group of features, such as the stem width or serif length. Control values are stored in a font table commonly referred to as a control value table ("cvt"). Some control values are specific to certain glyphs, while other control values apply to the entire font. Requiring hints to refer to control values makes it easier to preserve regularity between the glyphs of the font.
Yet another drawback of the Fontographer program is that it displays hints outside the glyph outline, making it difficult to identify the control points associated with a hint. Furthermore, Fontographer does not have a built-in rasterizer so a typographer cannot immediately see how a hint affects the appearance of a rendered glyph. Thus, it is difficult to fine-tune pixel patterns and stroke weights.
Accordingly, there is a need in the art for a method for converting graphical hints into high-level hinting instructions. There is also a need in the art for a method for converting high-level hinting instructions into graphical hints.